package com.p900.website.web;

import com.p900.website.service.PlatformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * Created by lenovo on 2015/5/1.
 */
@Controller
public class PlatformController{

    @Autowired
    private PlatformService platformService;

    @RequestMapping("/platform/{id}")
    public String get(@PathVariable Long id, Map<String, Object> model){
        model.put("platform", platformService.findPlatform(id));
        return "site/platform";
    }


    @RequestMapping("/platform/platformView")
    public String platformView(Map<String, Object> model){
        model.put("platform", platformService.findAll(null));
        return "site/platform-list";
    }
}
